package cn.sciento.starter.lock.annotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.concurrent.TimeUnit;
import cn.sciento.starter.lock.enums.LockType;

@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface Lock {
  String name() default "";
  
  LockType lockType() default LockType.FAIR;
  
  long waitTime() default 60L;
  
  long leaseTime() default 60L;
  
  TimeUnit timeUnit() default TimeUnit.SECONDS;
  
  String[] keys() default {};
}
